<?php
/**
 * Created by PhpStorm.
 * User: figo-009
 * Date: 2017/5/17
 * Time: 17:00
 */
namespace ApigilityGroup\DoctrineEntity;

use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\Table;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\OneToOne;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\JoinTable;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\ManyToMany;
use Doctrine\ORM\Mapping\OneToMany;
use Doctrine\Common\Collections\ArrayCollection;

/**
 * Class ParticapationDetail
 * @package ApigilityGroup\DoctrineEntity
 * @Entity @Table(name="apigilitygroup_participation_detail")
 */
class ParticipationDetail
{
    /**
     * @Id @Column(type="integer")
     * @GeneratedValue
     */
    protected $id;

    /**
     * 参团价格
     *
     * @Column(type="decimal", precision=7, scale=2, nullable=false)
     */
    protected $price;

    /**
     * 参团时间
     *
     * @Column(type="datetime",nullable=false)
     */
    protected $participation_time;

    /**
     * 过期时间
     *
     * @Column(type="datetime",nullable=false)
     */
    protected $expires;

    /**
     * 参团类型
     *
     * @Column(type="smallint", nullable=true)
     */
    protected $type;

    /**
     * 参团人员
     *
     * @ManyToOne(targetEntity="ApigilityUser\DoctrineEntity\User")
     * @JoinColumn(name="user_id", referencedColumnName="id")
     */
    protected $user;

    /**
     * 所在团
     *
     * @ManyToOne(targetEntity="Group")
     * @JoinColumn(name="group_id", referencedColumnName="id")
     */
    protected $group;
    
    /**
     * 合约,参团时生成的合约
     *
     * @ManyToOne(targetEntity="ApigilityVIP\DoctrineEntity\Contract")
     * @JoinColumn(name="contract_id", referencedColumnName="id")
     */
    protected $contract;
    
    /**
     * 订单，订单参团时生成的订单
     *
     * @ManyToOne(targetEntity="ApigilityOrder\DoctrineEntity\Order")
     * @JoinColumn(name="order_id", referencedColumnName="id")
     */
    protected $order;

    /**
     * 参团状态
     *
     * @Column(type="smallint", nullable=true)
     */
    protected $status;
    
    public function __construct()
    {
        $this->user = new ArrayCollection();
        $this->group = new ArrayCollection();
        $this->contract = new ArrayCollection();
        $this->order = new ArrayCollection();
    }

    /**
     * @return mixed
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * @param mixed $id
     */
    public function setId($id)
    {
        $this->id = $id;
    }

    /**
     * @return mixed
     */
    public function getPrice()
    {
        return $this->price;
    }

    /**
     * @param mixed $price
     */
    public function setPrice($price)
    {
        $this->price = $price;
    }

    /**
     * @return mixed
     */
    public function getParticipationTime()
    {
        return $this->participation_time;
    }

    /**
     * @param mixed $participation_time
     */
    public function setParticipationTime($participation_time)
    {
        $this->participation_time = $participation_time;
    }

    /**
     * @return mixed
     */
    public function getExpires()
    {
        return $this->expires;
    }

    /**
     * @param mixed $expires
     */
    public function setExpires($expires)
    {
        $this->expires = $expires;
    }

    /**
     * @return mixed
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * @param mixed $type
     */
    public function setType($type)
    {
        $this->type = $type;
    }

    /**
     * @return mixed
     */
    public function getUser()
    {
        return $this->user;
    }

    /**
     * @param mixed $user
     */
    public function setUser($user)
    {
        $this->user = $user;
    }

    /**
     * @return mixed
     */
    public function getGroup()
    {
        return $this->group;
    }

    /**
     * @param mixed $group
     */
    public function setGroup($group)
    {
        $this->group = $group;
    }

    /**
     * @return mixed
     */
    public function getContract()
    {
        return $this->contract;
    }

    /**
     * @param mixed $contract
     */
    public function setContract($contract)
    {
        $this->contract = $contract;
    }

    /**
     * @return mixed
     */
    public function getOrder()
    {
        return $this->order;
    }

    /**
     * @param mixed $order
     */
    public function setOrder($order)
    {
        $this->order = $order;
    }

    /**
     * @return mixed
     */
    public function getStatus()
    {
        return $this->status;
    }

    /**
     * @param mixed $status
     */
    public function setStatus($status)
    {
        $this->status = $status;
    }

}